package cn.quevo.ucenter.server.service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.quevo.core.exception.CustomException;
import cn.quevo.ucenter.server.dao.OauthCodeDao;
import cn.quevo.ucenter.server.entity.OauthCode;
import cn.quevo.ucenter.server.entity.query.OauthCodeQuery;
import cn.quevo.ucenter.server.service.OauthCodeService;

/**
 * 授权码Dao接口实现
 * 
 * @author July july_sky@foxmail.com
 * @date 2018年3月26日 下午9:53:19
 * @Copyright ©2015-2035 湘豫(北京)科技有限公司. All Rights Reserved.
 * @version 1.0
 */
@Service("oauthCodeService")
@Transactional(transactionManager="transactionManager",rollbackFor={Exception.class})
public class OauthCodeServiceImpl implements OauthCodeService {

    @Resource(name = "oauthCodeDao")
    private OauthCodeDao oauthCodeDao;
    
    @Override
    public Integer createOauthCode(OauthCode oauthCode) throws CustomException {
        return this.oauthCodeDao.create(oauthCode);
    }

    @Override
    public Integer deleteOauthCode(OauthCode oauthCode) throws CustomException {
        return this.oauthCodeDao.delete(oauthCode);
    }

    @Override
    public OauthCode getOauthCode(OauthCodeQuery oauthCodeQuery) throws CustomException {
        return this.oauthCodeDao.getSinge(oauthCodeQuery);
    }
}
